const path = require('path')

function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = {
    lintOnSave: false,
    chainWebpack: (config) => {
        config.resolve.alias
        .set('@', resolve('src'))
    },
    devServer: {
        proxy: {
            '/api': {
                // target: 'http://localhost:9111/pub/kpi',
                target: 'http://161.117.1.210/kpi/pub', 
                // target: 'https://api.7xiaxia.com',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    }
}